package com.isoft.demo.dao;

import com.isoft.demo.entity.Emp;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface EmpDao {
    //增加
    @Insert("insert into employee (ename,ephone,esalary,epost,enumber,edirverid) values (#{ename},#{ephone},#{esalary},#{epost},#{enumber},#{edirverid})")
    int addEmp(Emp emp);
    //删除
    @Delete("delete from employee where eid=#{eid}")
    int deleteEmp(int eid);
    //修改
    @Update("update employee set ename=#{ename},ephone=#{ephone},esalary=#{esalary},epost=#{epost},enumber=#{enumber} where eid=#{eid}")
    int updateEmp(Emp emp);
    //查找
    @Select("select * from employee")
    List<Emp> findAllEmp();
    //根据id查询
    @Select("select eid from employee")
    List<Emp> findeByEid(Integer eid);

}
